package com.sky.mapper;

import com.sky.annotation.Autofill;
import com.sky.entity.DishFlavor;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishFlavorMapper {
    /**
     * 新增口味
     */

    void insert(List<DishFlavor> dishFlavorList);

    /**
     * 删除菜品对应的口味
     *
     * @param list
     * @return
     */
    void deleteByIds(List<Long> list);

    /**
     * 根据菜品id查询口味
     *
     * @param id
     * @return
     */
    @Select("select * from dish_flavor where dish_id =#{id}")
    List<DishFlavor> queryBydishId(Long id);

    /**
     * 根据菜品id删除口味
     *
     * @param DishId
     * @return
     */
    @Delete("delete from dish_flavor where dish_id = #{dishId}")
    void deleteByDishId(Long DishId);

    /**
     * 根据菜品id查询对应的口味
     *
     * @param id
     * @return
     */
    List<DishFlavor> getByDishId(Long id);
}
